home *** CD-ROM | disk | FTP | other *** search
- Path: news1.interserv.net!news
- From: <dvisage@interserv.com>
- Newsgroups: comp.lang.c++
- Subject: ifstream seek problem
- Date: 11 Feb 1996 21:50:09 GMT
- Organization: InterServ News Service
- Message-ID: <4floah$101@lal.interserv.net>
- NNTP-Posting-Host: dd06-002.compuserve.com
- Content-Type: text/plain
- Content-length: 2070
- X-Newsreader: AIR Mosaic (32-bit) 4.00
-
-
- Matthias Sodomann <Matthias.Sodomann@dlr.de> writes:
- >Hi there,
- >
- >I have a question concerning ifstream operation. I like to read a file.
- >It is ASCII. I got me an ifstream in; and opened the file with
- >in.open("filename",ios::in); So far so good. I read the whole file, and
- >after this I have to read it again. The reason doesn't matter! How do I
- >reset the file to start reading from the beginning WITHOUT closing and
- >reopening it? I tried to use in.seekg(0); or in.seekg(0,ios:beg); but
- >all this didn't help. What do I have to do? Or is this maybe a matter of
- >compiler? I work on a IBM RS600 AIX3.2 Workstation with the IBM C++
- >Compiler xlC.
- >
- >
- >I hope, and think, it is an easy problem.
- >
- >ThanX for reading this. Please give me some advice.
- >
- >Matthias
- >--
- >
- >========================================================================
- >| Matthias Sodomann | Phone: (+49)2203-601-2928 |
- >| DLR | FAX: (+49)2203-68309 |
- >| Linder Hoehe 90 | E-mail: Matthias.Sodomann@dlr.de |
- >|D-51147 Koeln | InterNet / WWW: http://dv.kp.dlr.de/~sodomann |
- >| Germany | anonymous ftp: 129.247.108.3 |
- >========================================================================
- >| |
- >| _/_/_/ _/ _/_/_/ //| |
- >| _/ _/ _/ _/ _/ ___// |___ |
- >| _/ _/ _/ _/_/_/_/ //___/ /__// |
- >| _/ _/ _/ _/ _/ || / |
- >| _/_/_/ _/_/_/_/ _/ _/ ||/ |
- >| |
- >========================================================================
- There is another member of ifstream that you may be able to use instead
- of seekg(). Look up seekoff, I think it takes similar parameters as seekg().
-
-